class CreateAdminDiretories < ActiveRecord::Migration
  def change
    create_table :diretories do |t|
      t.integer "province_id"
      t.integer "city_id"
      t.integer "category_id"
      t.timestamps
    end
    add_index :diretories, :city_id
    add_index :diretories, :province_id
    add_index :diretories, :category_id

    remove_column :programs, :province_id
    remove_column :programs, :city_id
    remove_column :programs, :category_id
    add_column :programs, :diretory_id, :integer
    add_index :programs, :diretory_id

  end
end
